# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DFAReporting.V33.Model.AdBlockingConfiguration do
  @moduledoc """
  Campaign ad blocking settings.

  ## Attributes

  *   `clickThroughUrl` (*type:* `String.t`, *default:* `nil`) - Click-through URL used by brand-neutral ads. This is a required field when overrideClickThroughUrl is set to true.
  *   `creativeBundleId` (*type:* `String.t`, *default:* `nil`) - ID of a creative bundle to use for this campaign. If set, brand-neutral ads will select creatives from this bundle. Otherwise, a default transparent pixel will be used.
  *   `enabled` (*type:* `boolean()`, *default:* `nil`) - Whether this campaign has enabled ad blocking. When true, ad blocking is enabled for placements in the campaign, but this may be overridden by site and placement settings. When false, ad blocking is disabled for all placements under the campaign, regardless of site and placement settings.
  *   `overrideClickThroughUrl` (*type:* `boolean()`, *default:* `nil`) - Whether the brand-neutral ad's click-through URL comes from the campaign's creative bundle or the override URL. Must be set to true if ad blocking is enabled and no creative bundle is configured.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :clickThroughUrl => String.t() | nil,
          :creativeBundleId => String.t() | nil,
          :enabled => boolean() | nil,
          :overrideClickThroughUrl => boolean() | nil
        }

  field(:clickThroughUrl)
  field(:creativeBundleId)
  field(:enabled)
  field(:overrideClickThroughUrl)
end

defimpl Poison.Decoder, for: GoogleApi.DFAReporting.V33.Model.AdBlockingConfiguration do
  def decode(value, options) do
    GoogleApi.DFAReporting.V33.Model.AdBlockingConfiguration.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DFAReporting.V33.Model.AdBlockingConfiguration do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
